package com.matt.controller.pad;

import com.matt.domain.teaching.TeachingMaterial;
import com.matt.commons.model.StatusResponse;
import com.matt.service.TeachingMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.matt.foundation.constant.RequestConstant.TICKET;


/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/7/11
 * *******************************
 */
@RestController
@RequestMapping("/pad/material")
public class PadMaterialController {

    @Autowired
    private TeachingMaterialService materialService;

    @RequestMapping("/detail")
    public StatusResponse detail(@RequestHeader(TICKET) String ticket, Long id){
        TeachingMaterial material = materialService.getByMaterialId(id);
        return StatusResponse.success(material);
    }
}
